package net.csdn.business.kanban.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ClassName AuditStatusEnum
 * @Description TODO
 * @Author liuzhisheng
 * @Date 2023/9/18
 **/
@Getter
@AllArgsConstructor
public enum AuditStatusEnum {
    /**
     * 资源审核状态
     */
    INIT(0, "初始状态"),
    AUDITING(1, "待审核、审核中"),
    PASS(10, "通过"),
    REVIEW(-10, "复核中"),
    FAIL(-30, "失败"),
    DELETE(-40, "删除"),
    ;
    private final Integer code;
    private final String desc;

    public static AuditStatusEnum ofCode(Integer code) {
        for (AuditStatusEnum auditStatusEnum : AuditStatusEnum.values()) {
            if (auditStatusEnum.code.equals(code)) {
                return auditStatusEnum;
            }
        }
        throw new IllegalArgumentException("AuditEnum#AuditStatusEnum param error");
    }
}
